function x = findnanequal(m,s)%x = FINDNANEQUAL(m,s)%   Equivalent to x = find(m==s) where m is a matrix and s is a scalar which%   might be NaN. Written because find() doesn't handle NaNs well. %% see also FIND% RCS INFO: $Id: findnanequal.m,v 1.1 1998/12/02 00:06:10 lab Exp lab $%% 5/14/98 - jpg wrote it% checking to see if isnan(s), and finding a suitable random replacement% value if it is.if isnan(s)  x = find(isnan(m));else  x = find(m==s);end